package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.vo.PriceT;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PurchaseMapper;
import com.ruoyi.system.domain.Purchase;
import com.ruoyi.system.service.IPurchaseService;

/**
 * 采购单Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-27
 */
@Service
public class PurchaseServiceImpl implements IPurchaseService 
{
    @Autowired
    private PurchaseMapper purchaseMapper;

    /**
     * 查询采购单
     * 
     * @param purchaseID 采购单主键
     * @return 采购单
     */
    @Override
    public Purchase selectPurchaseByPurchaseID(Long purchaseID)
    {
        return purchaseMapper.selectPurchaseByPurchaseID(purchaseID);
    }

    /**
     * 查询采购单列表
     * 
     * @param purchase 采购单
     * @return 采购单
     */
    @Override
    public List<Purchase> selectPurchaseList(Purchase purchase)
    {
        return purchaseMapper.selectPurchaseList(purchase);
    }

    /**
     * 新增采购单
     * 
     * @param purchase 采购单
     * @return 结果
     */
    @Override
    public int insertPurchase(Purchase purchase)
    {
        return purchaseMapper.insertPurchase(purchase);
    }

    /**
     * 修改采购单
     * 
     * @param purchase 采购单
     * @return 结果
     */
    @Override
    public int updatePurchase(Purchase purchase)
    {
        return purchaseMapper.updatePurchase(purchase);
    }

    /**
     * 批量删除采购单
     * 
     * @param purchaseIDs 需要删除的采购单主键
     * @return 结果
     */
    @Override
    public int deletePurchaseByPurchaseIDs(Long[] purchaseIDs)
    {
        return purchaseMapper.deletePurchaseByPurchaseIDs(purchaseIDs);
    }

    /**
     * 删除采购单信息
     * 
     * @param purchaseID 采购单主键
     * @return 结果
     */
    @Override
    public int deletePurchaseByPurchaseID(Long purchaseID)
    {
        return purchaseMapper.deletePurchaseByPurchaseID(purchaseID);
    }

    @Override
    public List<PriceT> selectPurchByWeek() {
        return purchaseMapper.selectPurchByWeek();
    }
}
